package com.binarysoft.service.common.snmp;

import java.util.Collection;

import common.framework.dsb.DynamicService;

public interface SnmpService extends DynamicService {
	/**
	 * 标量SNMP对象,具有一个索引为0的实例对象 (类型一)
	 */
	int SINGLE_INSTANCE_OBJECT = 1;
	/**
	 * 向量SNMP对象,无索引对象,具有多个实例对象 (类型二)
	 */
	int MULTI_INSTANCE_OBJECT_WITHOUT_INDEX = 2;
	/**
	 * 向量SNMP对象,索引由单个或者多个类型二的SNMP实例的值确定
	 */
	int MULTI_INSTANCE_OBJECT_WITH_INDEX = 3;

	/**
	 * default index of single instance object
	 */
	String DEFAULT_INDEX = "0";
	String DEFAULT_SUB_OID = ".0";
	long DEFAULT_LONG_VALUE = -1;
	/**
	 * SNMP versions
	 */
	int VERSION1 = 0;
	int VERSION2C = 1;
	int VERSION2U = 2;
	int VERSION3 = 3;
	/**
	 * security levels
	 */
	int NOAUTH_NOPRIV = 1;
	int AUTH_NOPRIV = 2;
	int AUTH_PRIV = 3;

	/**
	 * Auth protocol
	 */
	int AUTH_MD5 = 1;
	int AUTH_SHA = 2;

	/**
	 * Priv protocol
	 */
	int PRIV_AES = 1;
	int PRIV_AES128 = 2;
	int PRIV_AES192 = 3;
	int PRIV_AES256 = 4;
	int PRIV_DES = 5;

	/**
	 * value type
	 */
	int TYPE_STRING = 0;
	int TYPE_LONG = 1;
	int TYPE_DOUBLE = 2;
	int TYPE_BOOL = 3;
	int TYPE_DATE = 4;

	String CHARSET_GB2312 = "GB2312";
	String CHARSET_UTF8 = "UTF-8";

	/**
	 * OID single object SNMP query. 如果抛出AbortException,则说明agent不可用，即SNMP服务没有开启
	 * 如果SnmpValue的值为空,则说明snmp agent可用，但不支持该mib OID
	 * 
	 * @param snmpObject
	 * @return
	 * @throws Exception
	 */
	SnmpResult snmpGet(SnmpObject snmpObject, SnmpTarget target) throws Exception;

	/**
	 * multiple objects snmp query 如果抛出AbortException,则说明agent不可用，即SNMP服务没有开启
	 * 如果SnmpValue的值为空,则说明snmp agent可用，但不支持该mib OID
	 * 
	 * @param objectList
	 * @return
	 * @throws Exception
	 */
	SnmpResult snmpGet(Collection<SnmpObject> objectList, SnmpTarget target) throws Exception;

	/**
	 * Get SNMP resource pool size.
	 * 
	 * @return
	 */
	int getPoolSize();
}
